/*
 * @Descripttion: 说明
 * @version: V1.0
 * @Author: GaoWei
 * @Date: 2021-04-25 12:11:55
 * @LastEditors: GW
 * @LastEditTime: 2021-12-18 17:28:02
 */
import { axios } from '../../utils/request'

const api = {
    save: '/purchase/purchaseInvoice/save',
    examine: '/purchase/purchaseInvoice/examine',
    delete: '/purchase/purchaseInvoice/delete',
    getcode: '/purchase/purchaseInvoice/getCode',

    getCodeForDelegate:'/purchase/purchaseInvoice/getCodeForDelegate',//获取委外发票编码
    saveOrderForDelegate:'/purchase/purchaseInvoice/saveOrderForDelegate',//保存委外发票
}
/**
 * 保存采购发票
 */
export function save(data) {
    return axios({
        url: api.save,
        method: "post",
        data: data
    })
}

/**
 * 审核采购发票
 */
export function examine(data) {
    return axios({
        url: api.examine,
        method: "get",
        params: data
    })
}

/**
 * 删除采购发票
 */
export function remove(data) {
    return axios({
        url: api.delete,
        method: "DELETE",
        params: data
    })
}

/**
 * 获取采购发票单据编号
 */
export function getCode(data) {
    return axios({
        url: api.getcode,
        method: "get",
        params: data
    })
}

export function getCodeForDelegate(data) {
    return axios({
        url: api.getCodeForDelegate,
        method: "get",
        params: data
    })
}

export function saveOrderForDelegate(data) {
    return axios({
        url: api.saveOrderForDelegate,
        method: "post",
        data: data
    })
}
/**
 * 单据提交
 */
 export function submitOrder (data) {
    return axios({
        url: '/purchase/purchaseInvoice/submit',
        method: "get",
        params: data
    })
}
